﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using MasterDetailTemplate.Models;

namespace MasterDetailTemplate.Services
{
    /// <summary>
    /// 菜品收藏类
    /// </summary>
    public interface IFavoriteStorageService
    {
        Task InitializeAsync();

        bool IsInitialized();

        Task<Favorite> getFavoriteAsync(int poetryId);

        Task refreshFavorite(Favorite favorite);

        Task<List<Favorite>> GetFavoritesAsync();
        
        Task CloseConnection();
    }

    public static class FavoriteStorageConstants {
        public const int VERSION = 1;
        public const int DEFAULTVERSION = -1;

        public const string VersionKey = nameof(FavoriteStorageConstants) + "." +
            nameof(VERSION);
    }
}
